Count Subarrays of Length Three